#include<iostream.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/wait.h>
int main ( ) { int i, pid; pid = fork(); wait(NULL); if(pid == 0) cout<<"Child with id "<< getpid( ) <<" is running!"<<endl; else cout<<"Parent with id "<<getpid( ) <<" is running!"<<endl; for ( i = 0; i < 5; i++) { cout << getpid() << ' ' << i << endl; } }